package com.sy.dao;

import com.sy.entity.Coupon;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;


/**
 * @description: 码起 自动生成代码
 * @author: 小毛
 * @create: 2020-11-30 11:42:53
 */
public interface CouponDao {
    /*新增*/
    @Insert("insert into coupon (id,user_id,coupon_code,assign_time,status) values(#{id},#{user_id},#{coupon_code},#{assign_time},#{status})")
    int insert(Coupon coupon);

    /*删除*/
    @Delete("delete from coupon where id=#{id}")
    int deleteById(int id);
    /*查询全部*/
    @Select("select * from coupon")
    List<Coupon> all();

    /*查询全部*/
    @Select("select * from coupon where user_id = #{uid}")
    List<Coupon> selectByuId(Integer uid);
}